package me.stone.stanimeclient.core.common.extensions

import android.content.Context
import android.content.pm.PackageManager
import androidx.core.app.ActivityCompat

fun Context.grantedSelfPermission(permission: String): Boolean {
    return ActivityCompat.checkSelfPermission(
        this, permission
    ) == PackageManager.PERMISSION_GRANTED
}

fun Context.grantedSelfPermissions(permissions: Array<String>): Boolean {
    return permissions.all { grantedSelfPermission(it) }
}